package org.reos;

import org.reos.ReGenerator.ReGenerator;
import org.reos.ReParser.ReParser;
import org.reos.ReParser.ISection;

import java.util.ArrayList;

public class ReGen {

	private static String[] expectedArgs = {
		"A path to an input file"
	};
	
	public static void main(String[] args) {
		if (args.length != expectedArgs.length) {
			System.out.println("There is wrong number of input arguments");
			System.out.println(expectedArgs.length + " argument(s) expected:");
			for (int i = 0; i < expectedArgs.length; i++) {
				System.out.println("\t - " + expectedArgs[i]);
			}
			return;
		}
		
		System.out.println("Using \"" + args[0] + "\" to generate output data");
        ReParser reParser = new ReParser();
        if (reParser.parseConfigFile(args[0])) {
			System.out.println("The input file has been parsed");
            new ReGenerator().Generate(reParser.getParserData());
  		} else {
			System.out.println("GENERATION FAILED. Could not generate output files due to the above errors");
		}

	}


}
